home *** CD-ROM | disk | FTP | other *** search
- this.timerMask_mc._yscale = 0;
- this.init = function()
- {
- if(this.pPause == undefined)
- {
- this.pPause = true;
- this.pSpeed = 0.2;
- this.pTime = 100;
- this.pStep = 100;
- }
- };
- this.increaseSpeed = function()
- {
- this.pSpeed += 0.02;
- };
- this.addTimer = function(t)
- {
- this.pTime += t * 1.5;
- this.pStep = this.pTime;
- this.drawTimer();
- };
- this.resetTimer = function()
- {
- this.pPause = true;
- this.pStep = 100;
- this.pTime = 100;
- };
- this.pauseTimer = function()
- {
- delete onEnterFrame;
- this.pPause = true;
- };
- this.resumeTimer = function()
- {
- this.onEnterFrame = animate;
- this.pPause = false;
- };
- this.fire = function()
- {
- this.pauseTimer();
- this._parent.grid_mc.gameOver();
- this._parent.grid_mc.selector_mc.removeSelector();
- };
- this.drawTimer = function()
- {
- if(this.pTime > 100)
- {
- this.pTime = 100;
- }
- else if(this.pTime < 0)
- {
- this.pTime = 0;
- this.fire();
- }
- if(this.pTime <= this.pStep)
- {
- this.pStep -= 2;
- this.timerMask_mc._yscale = 100 - this.pTime;
- }
- };
- this.animate = function()
- {
- this.pTime -= this.pSpeed;
- this.drawTimer();
- };
- this.init();
- stop();
-